package com.example.yichuangyun.model.business;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class BusinessModel implements Parcelable {
    /**
     * 客户姓名
     */
    private String userName;
    /**
     * 电话号码格式（默认号码为1）：{15515455899:1,18236754214:0}
     */
    private String telNumber;
    /**
     * 客户ID
     */
    private String id;
    /**
     * 商机编码
     */
    private String sjCode;
    private String business;
    /**
     * 公司名称
     */
    private String companyName;
    private String creditNo;

    private List<Integer> sources;

    private int isOrder;

    /**
     * 创建时间
     */
    private String createTime;
    /**
     * 意向产品
     */
    private List<ProductModel> products;
    /**
     * 公司名称
     */
    private String compName;
    /**
     * 下次跟进时间
     */
    private String nextFollowTime;
    /**
     * 创建人
     */
    private String createUser;
    private String createUserId;
    /**
     * 跟进人
     */
    private String gdUser;
    private String gdUserId;
    /**
     * 商机进展
     */
    private String stepStatusName;
    private int stepStatus;

    private Integer lostRemindHour;

    /**
     * 权重
     */
    private String chanceWeight;

    /**
     * 入库时间
     */
    private String intoChanceTime;

    private List<TelModel> users;

    /**
     * 老客户
     */
    private int oldUser;

    /**
     * 废弃状态：0未废弃，1废弃审核中 2已废弃 3待复核
     */
    private int discardStatus;

    public BusinessModel(String userName) {
        this.userName = userName;
    }

    protected BusinessModel(Parcel in) {
        userName = in.readString();
        telNumber = in.readString();
        id = in.readString();
        sjCode = in.readString();
        business = in.readString();
        companyName = in.readString();
        creditNo = in.readString();
        isOrder = in.readInt();
        createTime = in.readString();
        compName = in.readString();
        nextFollowTime = in.readString();
        createUser = in.readString();
        createUserId = in.readString();
        gdUser = in.readString();
        gdUserId = in.readString();
        stepStatusName = in.readString();
        stepStatus = in.readInt();
        if (in.readByte() == 0) {
            lostRemindHour = null;
        } else {
            lostRemindHour = in.readInt();
        }
        chanceWeight = in.readString();
        intoChanceTime = in.readString();
        oldUser = in.readInt();
        discardStatus = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(userName);
        dest.writeString(telNumber);
        dest.writeString(id);
        dest.writeString(sjCode);
        dest.writeString(business);
        dest.writeString(companyName);
        dest.writeString(creditNo);
        dest.writeInt(isOrder);
        dest.writeString(createTime);
        dest.writeString(compName);
        dest.writeString(nextFollowTime);
        dest.writeString(createUser);
        dest.writeString(createUserId);
        dest.writeString(gdUser);
        dest.writeString(gdUserId);
        dest.writeString(stepStatusName);
        dest.writeInt(stepStatus);
        if (lostRemindHour == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(lostRemindHour);
        }
        dest.writeString(chanceWeight);
        dest.writeString(intoChanceTime);
        dest.writeInt(oldUser);
        dest.writeInt(discardStatus);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<BusinessModel> CREATOR = new Creator<BusinessModel>() {
        @Override
        public BusinessModel createFromParcel(Parcel in) {
            return new BusinessModel(in);
        }

        @Override
        public BusinessModel[] newArray(int size) {
            return new BusinessModel[size];
        }
    };

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getTelNumber() {
        return telNumber;
    }

    public void setTelNumber(String telNumber) {
        this.telNumber = telNumber;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSjCode() {
        return sjCode;
    }

    public void setSjCode(String sjCode) {
        this.sjCode = sjCode;
    }

    public String getBusiness() {
        return business;
    }

    public void setBusiness(String business) {
        this.business = business;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCreditNo() {
        return creditNo;
    }

    public void setCreditNo(String creditNo) {
        this.creditNo = creditNo;
    }

    public List<Integer> getSources() {
        return sources;
    }

    public void setSources(List<Integer> sources) {
        this.sources = sources;
    }

    public int getIsOrder() {
        return isOrder;
    }

    public void setIsOrder(int isOrder) {
        this.isOrder = isOrder;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public List<ProductModel> getProducts() {
        return products;
    }

    public void setProducts(List<ProductModel> products) {
        this.products = products;
    }

    public String getCompName() {
        return compName;
    }

    public void setCompName(String compName) {
        this.compName = compName;
    }

    public String getNextFollowTime() {
        return nextFollowTime;
    }

    public void setNextFollowTime(String nextFollowTime) {
        this.nextFollowTime = nextFollowTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getGdUser() {
        return gdUser;
    }

    public void setGdUser(String gdUser) {
        this.gdUser = gdUser;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getGdUserId() {
        return gdUserId;
    }

    public void setGdUserId(String gdUserId) {
        this.gdUserId = gdUserId;
    }

    public int getStepStatus() {
        return stepStatus;
    }

    public void setStepStatus(int stepStatus) {
        this.stepStatus = stepStatus;
    }

    public String getStepStatusName() {
        return stepStatusName;
    }

    public void setStepStatusName(String stepStatusName) {
        this.stepStatusName = stepStatusName;
    }

    public Integer getLostRemindHour() {
        return lostRemindHour;
    }

    public void setLostRemindHour(Integer lostRemindHour) {
        this.lostRemindHour = lostRemindHour;
    }

    public List<TelModel> getUsers() {
        return users;
    }

    public void setUsers(List<TelModel> users) {
        this.users = users;
    }

    public String getChanceWeight() {
        return chanceWeight;
    }

    public void setChanceWeight(String chanceWeight) {
        this.chanceWeight = chanceWeight;
    }

    public String getIntoChanceTime() {
        return intoChanceTime;
    }

    public void setIntoChanceTime(String intoChanceTime) {
        this.intoChanceTime = intoChanceTime;
    }

    public int getOldUser() {
        return oldUser;
    }

    public void setOldUser(int oldUser) {
        this.oldUser = oldUser;
    }

    public int getDiscardStatus() {
        return discardStatus;
    }

    public void setDiscardStatus(int discardStatus) {
        this.discardStatus = discardStatus;
    }

}
